#include "qelib.h"
#include "stdout.h"


static stdout_handle current_handle = QE_NULL;
static void *handle_priv = QE_NULL;

void qe_set_stdout(stdout_handle handle, void *priv)
{
    current_handle = handle;
    handle_priv = priv;
}

void qe_putc(char c)
{
    if (!current_handle) {
        qe_earlycon_putc(c);
    } else {
        current_handle(c, handle_priv);
    }
}
